// $Id: config.h 4 2008-09-08 18:17:41Z longerdev $

/*
Copyright (C) 2008 Longer <longerdev@gmail.com>

This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.

This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
GNU General Public License for more details.

You should have received a copy of the GNU General Public License
along with this program.  If not, see <http://www.gnu.org/licenses/>.
*/

#ifndef CONFIG_H
#define CONFIG_H

#include <iostream>
#include <fstream>
#include <map>
#include <vector>
#include <pcre.h>

using namespace std;

class Config{
	public:
		Config();
		
		int load(const char* fn);
		bool isNewSec(const std::string name);
		int getSecCount();
		std::string getValue(const std::string key);
		std::string getSection(const int id);
		bool isKey(const std::string key);
	private:
		ifstream fs;
		vector<std::string> sec;
		int secsz;
		map <std::string, std::string> data;
};

#endif

